print("I love China.")

s = '  python是一种解释型语言   '
# 去除两侧空格并替换p为P
result = s.strip().replace('p', 'P')
print(result)


s = 'tsacti'
# 使用切片[::-1]实现字符串逆序
reversed_s = s[::-1]
print(reversed_s)

sum = 0
for i in range(1, 101):
    sum += i
print("1到100的和为：", sum)

num = 0
while num < 100:
    if num % 2 == 0:
        print(num, end=" ")
    num += 1

for num in range(2, 101):
    is_prime = True
    for i in range(2, int(num ** 0.5) + 1):
        if num % i == 0:
            is_prime = False
            break
    if is_prime:
        print(num, end=" ")


